<template>
  <div id="map" ref="mapdom"></div>
</template>

<script>
import Vue from "vue";
import { gaode_vector, gaode_image } from "../libs/mapBase";
import * as ol from "ol";
let map = null;
let a = 5;
export default {
  mounted: function () {
    map = new ol.Map({
      target: this.$refs.mapdom,
      layers: [gaode_vector, gaode_image],
      view: new ol.View({
        center: [114.3, 30.5],
        zoom: 4,
        // 投影：经纬度坐标系
        projection: "EPSG:4326",
      }),
    });
    console.log(map, "map");
    console.log(a, "a");
    Vue.prototype.$map = map;
  },
};
</script>

<style lang="scss" scoped>
#map {
  width: 100vw;
  height: 100vh;
}
</style>
